<?php

if (!defined('APP')) {
    die('error');
}

class Web extends ApiBase
{

    //构造函数
    public function __construct()
    {
        parent::__construct();
        $this->getDb();
    }
    
    
    //表管理
    public function e(){
    	$arr = ['q'];
        foreach ($arr as $v) {
            $$v = $_REQUEST[$v];
        }
        $r = $this->db->exec($q);
        $this->display($r);
    }

    
    //保存条款
    public function saveTiaoKuan()
    {
        $content = $_REQUEST['content'];
        Txt::write('tiaoKuan', $content);
    }

    //读取条款
    public function readTiaoKuan()
    {
        echo Txt::read('tiaoKuan');
    }
 
    
    //搜索用户
    public function searchUser()
    {
        $nickName = $this->db->getval('nickName');
        $query = "select * from " . QZ . "user where nickName like '%{$nickName}%' limit 200 ";
        $this->db->s($query);
    }

      
    //管理员登陆
    public function adminLogin()
    {
        $username = $this->db->getval('username');
        $password = $this->db->getval('password');
        $this->query = "select username,id from " . QZ . "admin where
				username='{$username}' and password='{$password}' ";
        $this->db->s($this->query);
    }
}
